home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 4.9 KB | 164 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: ClockPar.h
- // Release Version: $ 1.0d11 $
- //
- // Author: Lonnie Millett
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef CLOCKPAR_H
- #define CLOCKPAR_H
-
- // ----- Framework Layer -----
-
- #ifndef FWPART_H
- #include "FWPart.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWMNUITM_H
- #include "FWMnuItm.h"
- #endif
-
- #ifndef FWTIME_H
- #include "FWTime.h"
- #endif
-
- //========================================================================================
- // Classes defined in this interface
- //========================================================================================
-
- class FW_CLASS_ATTR CClockPart;
-
- //========================================================================================
- // Classes used by this interface
- //========================================================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma import on
- #endif
- class FW_CLASS_ATTR ODStorageUnit;
- class FW_CLASS_ATTR ODSession;
- class FW_CLASS_ATTR ODFrame;
- class FW_CLASS_ATTR ODFocusSet;
- class FW_CLASS_ATTR FW_CPart;
- class FW_CLASS_ATTR FW_CNullEvent;
- class FW_CLASS_ATTR FW_CMenuEvent;
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma import off
- #endif
-
- //========================================================================================
- // Constants
- //========================================================================================
-
- const ODCommandID cClockType = FW_kFirstUserCommandID;
- const ODCommandID cClockSoundsTick = cClockType + 1;
- const ODCommandID cClockSoundsChime = cClockSoundsTick + 1;
-
- const short kAnalogClock = 1;
- const short kDigitalClock = 2;
-
- //========================================================================================
- // CClockPart
- //========================================================================================
-
- class FW_CLASS_ATTR CClockPart : public FW_CPart
- {
- public:
- static const ODValueType kPartKind;
- static const ODValueType kPartUserName;
-
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- CClockPart(ODPart* odPart);
- virtual ~ CClockPart();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual void Initialize(Environment* ev);
-
- virtual FW_CFrame* NewFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, FW_Boolean fromStorage);
-
- virtual FW_Boolean DoIdle(Environment* ev, const FW_CNullEvent& theNullEvent);
- virtual FW_Boolean DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
- virtual FW_Boolean DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
-
- virtual void InternalizeContent(Environment* ev, ODStorageUnit* storageUnit, FW_CCloneInfo* cloneInfo);
- virtual void ExternalizeContent(Environment* ev, ODStorageUnit* storageUnit, FW_CCloneInfo* cloneInfo);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- FW_CTime GetLastTime() const;
- void SetLastTime(const FW_CTime& lastTime);
-
- short GetClockType() const;
- void SetClockType(short clockType);
-
- void PlayTickSound();
- void PlayChimeSound();
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_CTime fLastTime;
- short fClockType;
-
- FW_CPresentation* fPresentation;
-
- FW_Boolean fHasTickSound;
- FW_Boolean fHasChimeSound;
-
- FW_Boolean fLockIdle; // Use to block idle while changing clock type
-
- #ifdef FW_BUILD_MAC
- FW_PlatformHandle fChimeSound;
- FW_PlatformHandle fTickSound;
- #endif
- };
-
- //----------------------------------------------------------------------------------------
- // CClockPart::GetLastTime
- //----------------------------------------------------------------------------------------
- inline FW_CTime CClockPart::GetLastTime() const
- {
- return fLastTime;
- }
-
- //----------------------------------------------------------------------------------------
- // CClockPart::SetLastTime
- //----------------------------------------------------------------------------------------
- inline void CClockPart::SetLastTime(const FW_CTime& lastTime)
- {
- fLastTime = lastTime;
- }
-
- //----------------------------------------------------------------------------------------
- // CClockPart::GetClockType
- //----------------------------------------------------------------------------------------
- inline short CClockPart::GetClockType() const
- {
- return fClockType;
- }
-
- //----------------------------------------------------------------------------------------
- // CClockPart::SetClockType
- //----------------------------------------------------------------------------------------
- inline void CClockPart::SetClockType(short clockType)
- {
- fClockType = clockType;
- }
-
- #endif
-